import { IMDSkillConfigVal } from "../../config/SkillConfig";
import UnitX from "../../entity/UnitX";
import ArrowManager from "../../module/arrowabout/ArrowManager";
import L_String from "../../utils/L_String";
import Abs_IMDDmgSkillBase from "../Abs_IMDDmgSkillBase";

/**  */
export default class FireBallA extends Abs_IMDDmgSkillBase{



  public execDmgSkill(aux: UnitX,skillIdStr:string, imdSkillConfigVal:IMDSkillConfigVal): void {
    //一定要确保 imdSkillConfigVal.arrowConfig已经配置  这里使用强断言
    let funit=super.createArrowUnit(aux,imdSkillConfigVal.arrowConfig!)
    //使用ArrowManager创建一个通用箭矢实例  并且设置生命周期回调方法
    let arrowObj=ArrowManager.createArrow(funit,aux,true,
        {
            commonDmg:true,
            skillConfig:imdSkillConfigVal,
            skillLvl:aux.getUnitSkillLvl(skillIdStr),
            startCallback:(arrow,x,y)=>{
                console.log("~~~~~~pp火球飞行开始~~~~~")
            },
            moveCallback:(arrow,movedDis,x,y)=>{
                if(movedDis%10==0){
                    console.log("火球移动了:",movedDis)
                }
            },
            bunitSelectCallback:(bunitx: UnitX)=>{
                console.log("大火球选取了:",bunitx.name,'开始判断是否命中')
            },
            hitCallback:(ux:UnitX)=>{
                console.log("命中:",ux.name,'造成减速..')
            },
            endCallback:(arrow,movedDis,x,y)=>{
                console.log("~~~~~~火球飞行结束~~~~~  x:",x,",y:",y)
            }
            
        } 
            ,imdSkillConfigVal.onceHit);
    //调用父类通用箭矢直线移动方法        
    super.arrowMoveToSpellTargetByLine(arrowObj,imdSkillConfigVal.arrowConfig!);   
    

  }
 
 

  
}  